﻿{% extends "base.html" %}



{% block css %}
<link rel="stylesheet" href="/static/css/admin.css">
<link rel="stylesheet" href="/static/ztree3/css/bootstrapStyle/bootstrapStyle.css" type="text/css">

{% endblock %}

{% block center %}


<!--头部导航-->
<div class="panel panel-default center-top" style="min-width:1300px;" >
  <div class="panel-body">
    <ol class="breadcrumb" style="margin-bottom: 0px;background-color: #FFFFFF;">
      <li><a href="/" style="color: #377CD8;">首页</a></li>
      <li><a href="javascript:;">发布管理</a></li>
      <li class="active">{{ title }}</li>
    </ol>
  </div>
</div>



<!--用户信息-->
<div class="panel panel-default center-top" style="min-width:1300px;">
  <div class="panel-heading">
      <div class="row" style="padding-top:5px;padding-left:10px;">
          <div class="col-sm-3">
              <h5 style="color: #00B83F"> 更新请求 </h5>
          </div>
          <div class="col-sm-3 pull-right">
            <div class="input-group">
              <input type="text" class="form-control" style="color: #20B320;" id="search-key" placeholder="search ...">

                <span class="input-group-btn">
                    <button class="btn btn-success" type="button" id="sub-search" >查询</button>
                </span>
            </div>
          </div>

      </div>

  </div>

  <div class="panel-body" id="site-info">

        <div style="margin-bottom: 10px;">
            <div class="col-sm-12" id="tb-log">
                <table class="table table-hover table-bordered">
                  <thead>
                    <tr style="background-color: #f5f5f5; text-align:center">
                      <th>站点名称</th>
                      <th>用户</th>
                      <th>更新内容</th>
                      <th>ID</th>
                      <th>时间</th>
                      <th>状态</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody id="uplog_table">
                    {% for i in wchartlog_obj %}
                    <tr name="tbody">
                      <td>{{ i.site_name }}</td>
                      <td>{{ i.from_user }}</td>
                      <td ><div style="max-width:120px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;" name="up-connect">{{ i.up_connect }}</div></td>
                      <td>{{ i.up_id }}</td>
                      <td>{{ i.add_time|date:"Y-m-d H:i:s" }}</td>
                       {% if i.status == 'done' %}
                      <td style="color:green">{{ i.status }}</td>
                       {% else %}
                      <td style="color:red">{{ i.status }}</td>
                      {% endif %}
                      <td>
                          {% if i.status == 'done' %}
                          <a style="text-decoration:none;cursor: default;color: #9d9d9d" href ="javascript:return false;" onclick="return false;"  git_id="{{ i.id }}" data-toggle="tooltip" data-placement="left" title="更新"><span class="fa fa-cloud-download"></span></a>&nbsp;&nbsp;&nbsp;
                           {% else %}
                          <a href="javascript:;"  style="text-decoration:none;" name="up-wchartlog" git_id="{{ i.id }}" data-toggle="tooltip" data-placement="left" title="更新"><span class="fa fa-cloud-download"></span></a>&nbsp;&nbsp;&nbsp;
                          {% endif %}
                          <a href="javascript:;" style="text-decoration:none;" name="del-wchartlog" git_id="{{ i.id }}" data-toggle="tooltip" data-placement="right" title="删除"><span class="fa fa-trash"></span> </a>
                      </td>
                    {% endfor %}
                  </tbody>
                </table>

                <div class="text-right" style="margin-top:-30px;padding-right:9%">
                  <ul class="pagination" id="pagination">
                  </ul>
                </div>
            </div>
        </div>
  </div>
</div>


{% endblock %}


<!-- Modal -->
{% block modal %}



{% endblock  %}

{% block js %}

<script type="text/javascript" src="/static/js/code.js"></script>

<script type="text/javascript">

$("div[name='up-connect']").mouseover(function () {
    var up_content=$(this).html();
    var content_list = up_content.split('##');
    str_html = '';
    for(i=0;i<content_list.length;i++){
        str_html+="<p>"+content_list[i]+"</p>";

    }
    //$(this).popover('show');
    $(this).popover({
        trigger:"hover",
        placement:"right",
        html:true,
        content:str_html,
    });
    $(this).popover('show');

});

$("#sub-search").click(function () {

    var key = $("#search-key").val();
    $.post("/code/searchlog/",{'key':key},function (data) {
        $("#tb-log").empty();
        $("#tb-log").append(data);
    })

});


</script>
{% endblock %}


